<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪元素层叠</title>
    <style>
        div {
            width: 100%;
            height: 100vh;
            background-color: chartreuse;
        }
        div::before {
            content: '';
            display: block;
            position: absolute;
            z-index: -1;
            height: 100%;
            width: 100%;
            background-color: chocolate;
        }
    </style>
</head>
<body>
    <div>
        <h2>啊啊啊</h2>
    </div>
</body>
</html>